﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Models;
using Repository;

namespace Metier
{
    public static class GestionSpecialites
    {
        public static void Ajouter(Specialite specialites)
        {
            try
            {
                Specialite_Repo.Ajouter(specialites);
            }
            catch (ArgumentNullException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }

        public static List<Specialite> Lister()
        {
            try
            {
                return Specialite_Repo.RecupererTous();
            }
            catch (ArgumentNullException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static List<Specialite> Lister(string nom)
        {
            try
            {
                return Specialite_Repo.RecupererTousParNom(nom);
            }
            catch (ArgumentNullException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static void MettreAJour(Specialite specialite)
        {
            try
            {               
                Specialite_Repo.MiseAJour(specialite);
            }
            catch (ArgumentNullException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
       
         public static void Supprimer(Specialite specialite)
        {
            try
            {
                Specialite_Repo.Supprimer(specialite);
            }
            catch (ArgumentNullException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
